package c_list;


import java.util.Deque;
import java.util.LinkedList;

//LinkedList作为栈实现 (压栈\弹栈)
public class DequeDemo03 {
    public static void main(String[] args) {
        Deque<String> dq = new LinkedList<>();
        //压栈 - > 进入栈
        dq.push("lucy");
        dq.push("tom");
        dq.push("marry");
        System.out.println(dq);//[marry, tom, lucy]

        //弹栈 - 出栈
        String s = dq.pop();
        System.out.println(s);//marry
        System.out.println(dq);//[tom, lucy]
    }
}
